//  统一管理咱们项目用户相关的api接口

import { Response } from "../type";
import request from "@/utils/request";
import { LoginDTO, UserInfoVO } from "./type";

enum API {
  //  用户登录
  LOGIN_URL = "/user/login",
  //  获取用户信息
  USER_INFO_URL = "/user/info",
  //  用户退出
  LOGOUT_URL = "/user/logout"
}

//  暴露请求函数
//  用户登录
export const reqLogin = (data: LoginDTO) => request.post<any, Response<string>>(API.LOGIN_URL, data);
//  获取用户信息
export const reqUserInfo = () => request.get<any, Response<UserInfoVO>>(API.USER_INFO_URL);
// 退出登录
export const reqLogout = () => request.post<any, Response<void>>(API.LOGOUT_URL);



